package com.teach;

import java.util.Arrays;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;

public class Demo0103 {

	private static final ThreadLocalRandom r = ThreadLocalRandom.current();// 多线程随机数 ;直译 : 线程本地随机数

	public static void main(String[] args) {
		for (int x = 0; x < 100; x++) {
			int blue = 0;
			Integer[] red = new Integer[6];

			blue = r.nextInt(16) + 1;
			Integer[][] ball = new Integer[33][];
			for(int i=0;i<33;i++) {
				ball[i] = new Integer[] {i+1,r.nextInt()};
			}
			Arrays.sort(ball,(a,b)->a[1]-b[1]);
//			for(int i=0;i<33;i++) {
//				System.out.println("ball["+i+"]="+Arrays.toString(ball[i]));
//			}
//			
			for(int i=0;i<6;i++) {
				red[i] = ball[i][0];
			}
			
			Arrays.sort(red);

			System.out.println("蓝球:" + blue);
			System.out.println("红球:" + Arrays.toString(red));
		}
	}

}
